import request from '@/utils/request'
import store from '@/store'

// 获取全部产品
export function getAllAppList() {
  return request({
    url: '/common/appConfig/queryAppList',
    method: 'get'
  })
}

// 获取渠道
export function getChannelList (query) {
  return request({
    url: '/common/channel/dictList',
    method: 'get',
    params: query
  })
}

// 获取项目列表
export function getProjectList (params = {}) {
  params.createBy = store.getters && store.getters.createBy;
  return request({
    url: '/manager/product/dictProject',
    method: 'get',
    params: params
  })
}

// 获取产品列表
export function getProductList (params = {}) {
  params.createBy = store.getters && store.getters.createBy;
  return request({
    url: '/manager/product/list',
    method: 'post',
    params: params
  })
}

// 获取包名
export function getApppkgList (query) {
  return request({
    url: '/common/apppkg/dictList',
    method: 'get',
    params: query
  })
}

export function queryQuickProjectAndProduct() {
  return request({
    url: '/manager/quick/pkg/config/queryQuickProjectAndProduct',
    method: 'get'
  })
}
